package com.example.eurekaclient;

import com.example.eurekaclient.utils.ResponseResult;
import com.example.eurekaclient.utils.ResponseResultUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@EnableEurekaClient
@SpringBootApplication
@RestController
public class EurekaclientApplication {

    @RequestMapping("/")
    public String home() {
        return "Hello World";
    }


    @RequestMapping("/sendMsg")
    public ResponseResult sendMsg(@RequestParam String msg){
        Map<String, Object> map = new HashMap<>();
        map.put("name","admin");
        map.put("tel","123456789");
        map.put("content",msg);
        return ResponseResultUtil.successs(map);
    }


    public static void main(String[] args) {
        SpringApplication.run(EurekaclientApplication.class, args);
    }

}
